<template>
  <el-header>
      <div>
        <img src="~assets/img/heima.png" alt="" />
        <span>你好</span>
      </div>
      <el-button type="info" @click="loginOut">退出</el-button>
    </el-header>
</template>

<script>
export default {
name: 'ContaHeader',
methods: {
  loginOut() {
      window.sessionStorage.clear()
      this.$router.replace('/login')
      // 这里没生效 我站且蒙古
    },
}
}
</script>

<style lang="less" scoped>
.el-header {
  padding-left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #373d41;
  color: #fff;
  font-size: 20px;
  > div {
    display: flex;
    align-items: center;
    span {
      margin-left: 15px;
    }
  }
}
</style>